<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="shortcut icon" href="fyicon.ico"> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>飞扬报修系统</title>
    <link href="__PUBLIC__/css/bootstrap.css" rel="stylesheet">
    <link href="__PUBLIC__/css/style.css" rel="stylesheet">
    <script type="text/javascript" src="__PUBLIC__/js/jquery-1.9.1.min.js"></script>
</head>

<body>
<input type="hidden" id="token" value="@#$_GET['token']#@">
 <div class="navbar navbar-fixed-bottom navbar-inverse" role="navigation">
       <div class="container">   
       	  <ul class="nav nav-pills">
            <li class="active"><a href="__APP__/Home/Index/index?token=@#$_GET['token']#@">飞扬报修</a></li>
            <li><a href="__APP__/Home/IndexPage/order?token=@#$_GET['token']#@">查看订单</a></li>
            <li><a href="__APP__/Home/AccountPage/logout">退出</a></li>
          </ul>
       </div>
    </div>
    
<div class="container">
	<br><br>
    <form class="form-info">
      <p class="text-warning">请完善您的信息，以便我们及时处理您的报修请求。</p>
      <input type="hidden" id="tel" value="@#$_SESSION['tel']#@" />
      <p>姓名：
        <input class="form-control" type="text" name="name" id="user_name"/>
        <div id="error_name" class="text-danger"> ！请输入姓名</div>
      </p>
      <p>
        <button class="btn btn-lg btn-primary btn-block" name="button"type="button"  id="next" />下一步
        </button>
      </p>
    </form>
</div> <!-- /container -->

<script type="text/javascript">
$(document).ready(function(){
    var token=$("#token").val();
  $("#error_name").hide();
  //按下回车
  $("body").keydown(function() {
    if (event.keyCode == "13"){
      var name_value=$("#user_name").val();
      var tel=$("#tel").val();
      if(name_value==""){
        $("#error_name").show();
      }
      else{ $("#error_name").hide();}

      if(name_value!=""){
        //若均填写隐藏提示信息
        $("#error_name").hide();
        $("#next").text('处理中..');
        $.post("__APP__/Home/Account/register?token="+token, {name:name_value,tel:tel},function(data){
          if(data.status==0){
            alert(data.info);
             $("#next").text('下一步');
          }else{ 
             $("#next").text('成功！跳转中..');
             window.location.href="__APP__/Home/IndexPage/registerpc?token="+token;//跳转到下一页面
            }
        });
      }
    }
  });
  $("#next").on("click",function(){
    var name_value=$("#user_name").val();
      var tel=$("#tel").val();
    if(name_value==""){
      $("#error_name").show();
    }
    else{ $("#error_name").hide();}
    

    if(name_value!=""){
      //若均填写隐藏提示信息
      $("#error_name").hide();
      $("#next").text('处理中..');
    // alert(weixin_key);
      $.post("__APP__/Home/Account/register?token="+token, {name:name_value,tel:tel},function(data){
        if(data.status==0){
          alert(data.info);
           $("#next").text('下一步');
        }else{ 
           $("#next").text('成功！跳转中..');
           window.location.href="__APP__/Home/IndexPage/registerpc?token="+token;//跳转到下一页面
          }
      });
    }
  });
});
</script>
</body>
</html>
